"use strict";

import { createStore, applyMiddleware } from "redux";
import thunkMiddleware from "redux-thunk";
import { composeWithDevTools } from "redux-devtools-extension";
// import logger from "redux-logger";//生成日志的中间件
import reducers from "../reducers/";

//异步中间件
let middleware = applyMiddleware(thunkMiddleware);

//查看redux状态变化的插件
if (process.env.NODE_ENV !== "production") {
  middleware = composeWithDevTools(middleware);
}

const store = createStore(reducers, middleware);

export default store;
